package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCompanyReportReasonMapper;
import com.ruoyi.system.domain.SysCompanyReportReason;
import com.ruoyi.system.service.ISysCompanyReportReasonService;

/**
 * 诊断报告原因模版库Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-19
 */
@Service
public class SysCompanyReportReasonServiceImpl implements ISysCompanyReportReasonService 
{
    @Autowired
    private SysCompanyReportReasonMapper sysCompanyReportReasonMapper;

    /**
     * 查询诊断报告原因模版库
     * 
     * @param reasonId 诊断报告原因模版库主键
     * @return 诊断报告原因模版库
     */
    @Override
    public SysCompanyReportReason selectSysCompanyReportReasonByReasonId(Long reasonId)
    {
        return sysCompanyReportReasonMapper.selectSysCompanyReportReasonByReasonId(reasonId);
    }

    /**
     * 查询诊断报告原因模版库列表
     * 
     * @param sysCompanyReportReason 诊断报告原因模版库
     * @return 诊断报告原因模版库
     */
    @Override
    public List<SysCompanyReportReason> selectSysCompanyReportReasonList(SysCompanyReportReason sysCompanyReportReason)
    {
        return sysCompanyReportReasonMapper.selectSysCompanyReportReasonList(sysCompanyReportReason);
    }

    /**
     * 新增诊断报告原因模版库
     * 
     * @param sysCompanyReportReason 诊断报告原因模版库
     * @return 结果
     */
    @Override
    public int insertSysCompanyReportReason(SysCompanyReportReason sysCompanyReportReason)
    {
        sysCompanyReportReason.setCreateTime(DateUtils.getNowDate());
        return sysCompanyReportReasonMapper.insertSysCompanyReportReason(sysCompanyReportReason);
    }

    /**
     * 修改诊断报告原因模版库
     * 
     * @param sysCompanyReportReason 诊断报告原因模版库
     * @return 结果
     */
    @Override
    public int updateSysCompanyReportReason(SysCompanyReportReason sysCompanyReportReason)
    {
        sysCompanyReportReason.setUpdateTime(DateUtils.getNowDate());
        return sysCompanyReportReasonMapper.updateSysCompanyReportReason(sysCompanyReportReason);
    }

    /**
     * 批量删除诊断报告原因模版库
     * 
     * @param reasonIds 需要删除的诊断报告原因模版库主键
     * @return 结果
     */
    @Override
    public int deleteSysCompanyReportReasonByReasonIds(Long[] reasonIds)
    {
        return sysCompanyReportReasonMapper.deleteSysCompanyReportReasonByReasonIds(reasonIds);
    }

    /**
     * 删除诊断报告原因模版库信息
     * 
     * @param reasonId 诊断报告原因模版库主键
     * @return 结果
     */
    @Override
    public int deleteSysCompanyReportReasonByReasonId(Long reasonId)
    {
        return sysCompanyReportReasonMapper.deleteSysCompanyReportReasonByReasonId(reasonId);
    }
}
